define(function(require) {
	// var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");

	var Model = function() {
		this.callParent();
		this.ret_Content = "";
	};
	Model.prototype.FranchiserStockApi = function(res_CtmNo, res_Type) {
		console.log("FranchiserStockApi()");
		var api_url = window.app.base_url + window.app.FranchiserStockApi;
		var data = {};
		data.username = window.app.username;
		data.password = window.app.password;
		data.Type = "2";// res_Type;
		data.CtmNo = "";// res_CtmNo;
		var self = this;
		this.comp("Send_data").clear();
		$.ajax({
			type : "POST",
			url : require.toUrl(api_url),
			data : {
				'data' : JSON.stringify(data)
			},
			dataType : 'json',
			success : function(res) {
				console.log(res);
				self.comp("Send_data").loadData(res);
				return;
			},
			error : function(e) {
				justep.Util.hint("网络出错，无法获取下级分销商信息。");
				return;
			}
		});
	};
	Model.prototype.modelParamsReceive = function(event) {
		console.log(event);
		this.ret_Content = event.params.Content;
		this.FranchiserStockApi(event.params.CtmNo, "1");
	};

	Model.prototype.ret_btnClick = function(event) {
		this.getParent().comp("contents1").to(this.ret_Content);
	};

	return Model;
});